#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>
using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<vector<int>> dp(n, vector<int>(n, 0));

	for (int i = 0; i < n; i++)
	{
		dp[i][0] = dp[i][i] = 1;
	}

	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j < i; j++)
		{
			dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1];
		}
	}

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			printf("%5d", dp[i][j]);
		}
		printf("\n");
	}

	return 0;
}